package leetcode.tree;

import leetcode.tree.common.TreeNode;
import leetcode.tree.common.TreeUtils;

import java.util.Arrays;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 * int val;
 * TreeNode left;
 * TreeNode right;
 * TreeNode() {}
 * TreeNode(int val) { this.val = val; }
 * TreeNode(int val, TreeNode left, TreeNode right) {
 * this.val = val;
 * this.left = left;
 * this.right = right;
 * }
 * }
 */
class Solution508 {
    public int[] findFrequentTreeSum(TreeNode root) {
        return TreeUtils.findFrequentTreeSum(root);
    }
}

public class leetcode508 {
    public static void main(String[] args) {
        Solution508 solution508 = new Solution508();
        Integer[] nums = {5, 2, -5};
        System.out.println(Arrays.toString(solution508.findFrequentTreeSum(TreeUtils.generateLeetcodeTree(nums))));
    }
}
